#include "mcu_regs.h"
#include "types.h"
#include "init.h"

#ifndef _EVENT_H_
#define _EVENT_H_

#define EVENT_UI_NOP               (0)
#define EVENT_UI_DCIN_OUT          (1 << 4)
#define EVENT_UI_DCIN_IN           (1 << 3)
#define EVENT_UI_KEY_CLICK         (1 << 2)
#define EVENT_UI_KEY_LONGPRESS_2S  (1 << 1)
#define EVENT_UI_CHARGER_END       (1 << 0)

#define EVENT_UI_KEY_ALL           (EVENT_UI_KEY_CLICK | EVENT_UI_KEY_LONGPRESS_2S)

#define EVENT_SYS_BATLOW           (1 << 0)
#define EVENT_SYS_OC               (1 << 1)
#define EVENT_SYS_LIGHT_LOAD       (1 << 2)

#define EVENT_SYS_ABNORMAL         (EVENT_SYS_BATLOW | EVENT_SYS_OC | EVENT_SYS_LIGHT_LOAD)

#define event_set_ui(ui)            (g_event_ui_mask |= ui)
#define event_get_ui_mask()         (g_event_ui_mask)
#define event_clear_ui(ui)          (g_event_ui_mask &= ~ui)
#define event_clear_all_ui_mask()   (g_event_ui_mask = 0)
#define event_set_sys_mask(ui)      (g_event_sys_mask |= ui)
#define event_get_sys_mask(ui)      (g_event_sys_mask)
#define event_clear_all_sys_mask()  (g_event_sys_mask = 0)
void event_clear_all(void);

#endif